package dstation.client;

import java.util.List;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

import dstation.databeans.ExceptionBean;
import dstation.databeans.ResultBean;
import dstation.databeans.ResultDisplayBean;
import dstation.databeans.RobotBean;
import dstation.databeans.SensorBean;
import dstation.databeans.TestBean;

@RemoteServiceRelativePath("AddRobot")
public interface AddRobot extends RemoteService {
	/**
	 * Utility class for simplifying access to the instance of async service.
	 */
	public static class Util {
		private static AddRobotAsync instance;
		public static AddRobotAsync getInstance(){
			if (instance == null) {
				instance = GWT.create(AddRobot.class);
			}
			return instance;
		}
	}
	
	public RobotBean addRobot(RobotBean r) throws ExceptionBean;
	
	public RobotBean lookupRobot(int id) throws ExceptionBean;
	
	public List<RobotBean> retrieveAll() throws ExceptionBean;
	
	public List<SensorBean> lookupSensors(int status) throws ExceptionBean;
	
	public List<ResultDisplayBean> lookupRobotResults(int id, int numResults, String robotName, String testName, String sensorName) throws ExceptionBean;

	public TestBean addTest(TestBean t) throws ExceptionBean;
	
	public List<TestBean> getTestTable() throws ExceptionBean;
	
	public TestBean lookupTest(int id) throws ExceptionBean;
	
	public TestBean updateTest(TestBean t) throws ExceptionBean;
	
	public ResultBean runTest(ResultBean r, TestBean t) throws ExceptionBean;

	public Boolean testHasNoResults(int testid) throws ExceptionBean;
}
